#ifndef _TEST_WINDOW_H_
#define _TEST_WINDOW_H_
#include<GL/glew.h>
#if defined ENABLE_OPENGL_CHECK
#define OPENGL_ERROR_CHECK \
{ \
GLenum __error = glGetError(); \
if (__error != GL_NO_ERROR) \
{ \
std::cout<<"Opengl Error!";<<__error<<std::endl; \
} \
}
#else
#define OPENGL_ERROR_CHECK ((void)0)
#endif


#if defined ENABLE_OPENGL_CHECK
#define OPENGL_CALL_CHECK(call) \
(call); \
OPENGL_ERROR_CHECK
#else
#define OPENGL_CALL_CHECK(call) (call)
#endif


#include<QGLWidget>
class TestGLWidget : QGLWidget
{
    Q_OBJECT;
public:
    virtual ~TestGLWidget(){}
public:
    QSize minimumSizeHint() const;
    QSize sizeHint() const;

    virtual void initializeGL();
    virtual void paintGL();
    virtual void resizeGL(int width, int height);
public:
    virtual void initScene();

};

#include<QWidget>
#include<QHBoxLayout>
#include <vector>
#include<iostream>
#include <QTimer>
class TestWindow : public QWidget
{
    Q_OBJECT;

public:
     TestWindow();
    ~TestWindow();


public:
    void add(TestGLWidget* testWidget)
    ;
    void run();
    void setWidget();

protected slots:
    void nextWidget();

protected:
    std::vector <TestGLWidget*>  m_glWidgets;

    std::vector <TestGLWidget*> ::iterator m_curIter;
};

//moc testWindow.h -o moc_testWindow.cpp
#endif


